import type { TYPE, ValueLabelType } from '@/constants';

export type CurrentUser = {
  // staffid: string;
  // staffName: string;
  name: string;
  // orgName: string;
  // access?: 'user' | 'guest' | 'admin';
  // email: string;
};

export type CompanyType = {
  parentCompanyStr: string;
  companyPhotoList: CompanyPhotoType[];
  companyId: number;
  companyName: string;
  otherName: string;
  type: number;
  cpMain: string;
  companyDesc: string;
  createUser: string;
  insertTime: string;
  modifyTime: string;
  parentCompany: number;
  cpCode: string;
  belongTo: string;
  department: number;
  health: number;
  healthRemarks: string;
  risk: number;
  riskRemarks: string;
};

export type WorksLyricsItem = {
  id?: string;
  worksId?: number;
  lyricsId?: number;
  lyricsName?: string;
  lyricsAuthors?: any[];
  createUser?: string;
  insertTime?: string;
  modifyTime?: string;
};

export type WorksMusicItem = {
  id?: string;
  worksId?: number;
  musicId?: number;
  musicName?: string;
  musicAuthors?: any[];
  createUser?: string;
  insertTime?: string;
  modifyTime?: string;
};

export type SongItem = {
  id?: string;
  trackId?: number;
  trackName?: string;
};

export type CompanyPhotoType = {
  companyId: number;
  id: number;
  photoUsing: number; // 是否使用中 解释：图片删除了，Fusing=0 默认值：0 定义： 0 未使用 1 使用中
  orderIndex: number; // 图片顺序 多图的顺序index 默认：0 代表第一张
  photoPath: string; // 图存储 解释：cos中路径，用竖线隔开，可用于生成下载url。 Appid|Bucket|ObjectPath
  photoUrl: string; // 图片url 解释：拼接的下载url
  md5: string; // 文件md5 解释：文件md5值，用于判断文件是否变化
  photoSize: number; // 源图文件大小
  photoHeight: number; // 源图高
  photoWidth: number; // 源图宽
  qCfs: string; // Q音图存储 解释：跟Q音曲库保持一致；存储可能有多种，cfs、cos、http
  qUrl: string; // Q音图片url 解释：下载url
  insertTime: string; // 插入时间
  modifyTime: string; // 修改时间
};

export type FileType = {
  md5?: string;
  photoPath?: string;
  photoUrl?: string;
  photoSize?: number;
  photoHeight?: number;
  photoWidth?: number;
  fileMd5?: string;
  mediaPath?: string;
  mediaUrl?: string;
  fileName?: string;
  fileType?: string;
  fileSize?: number;
  checkQuality?: string;
  duration?: number;
  licensePath?: string;
  licenseUrl?: string;
  [key: string]: string | number | undefined;
};

export type XmlType = {
  albumId: number; // 专辑ID
  tempAlbumId: number; // 临时库专辑ID
  albumUpc: string; // 专辑UPC
  cpId: number; // 版权公司ID
  albumXmlPath: string; // XML path
  albumXmlUrl: string; // XML cos url
  uploadTime: string; // 上传时间
};

export type CheckQualityResult = {
  checkQuality: string;
};

export type CopyrightData = {
  copyrightId: number;
  contract: string;
};

export type PaymentmodeDetail = {
  paymentModeId: number; // 付费ID
  paymentModeName: string; // 付费模式名
  paymentType: number; // 付费口径 字段定义： 0-免费 1 付费1.0 2 付费2.0 3 付费3.0 4 数字专辑 备注：单选
  contentType: number; // 内容类型 字段定义： 0 所有内容 1 歌曲 2 长音频 备注：0 代表所有内容都可配该模式
};

export type ComponentOptionsType = {
  mode?: 'multiple' | 'tags';
  options?: ValueLabelType[];
  valueString?: boolean;
  allowClear?: boolean;
  showSearch?: boolean;
  filterOption?: (input: any, option: any) => boolean;
  defaultValue?: string | number;
};

export type ReplaceType = {
  value: string;
  label: string;
  targetField?: string | string[];
  type?: TYPE;
  format?: (value: any) => any;
  componentOptions?: ComponentOptionsType;
};
